import request from '@/utils/request/request';
import {
  OperationLogParams,
  OperationLogRecord,
  OperationLogListRes,
} from '@/api/system/model/operationLogModel';

// 分页查询操作日志列表
export function queryOperationLogRecordList(params: OperationLogParams) {
  return request.get<OperationLogListRes>('/api/system/operate-log/page', {
    params,
  });
}

// 新增操作日志
export function addOperationLogRecord(data: OperationLogRecord) {
  return request.post('/api/system/operate-log', data);
}

// 修改操作日志
export function editOperationLogRecord(data: OperationLogRecord) {
  return request.put('/api/system/operate-log', data);
}

// 删除操作日志，传id数组，支持批量
export function deleteOperationLogRecords(data: any) {
  return request.delete('/api/system/operate-log', { data }); // 这里data要用{}，否则会报错
}
